package com.zyy.smartcity1129.parking;

import android.view.View;
import android.widget.TextView;

import com.zyy.smartcity1129.BaseFragment;
import com.zyy.smartcity1129.R;
import com.zyy.smartcity1129.data.ParkInfo;

/**
 * @ClassName: Parking1Fragment$
 * @Description: 作用
 * @Author: letquit
 * @CreateDate: 4/12/2021$
 * @Version: 1.0
 */
public class Parking1Fragment extends BaseFragment {
    private ParkInfo.RowsBean park = ParkingFragment.park;
    private TextView tv8;
    private TextView tv9;
    private TextView tv10;
    private TextView tv11;
    private TextView tv12;
    private TextView tv13;
    private TextView tv14;

    @Override
    protected int layId() {
        return R.layout.f_parking1;
    }

    @Override
    protected String title() {
        return park.getParkName();
    }

    @Override
    protected boolean back() {
        return true;
    }

    @Override
    protected Boolean bottom() {
        return false;
    }

    @Override
    protected void init(View iv) {
        initView(iv);
        tv8.setText(park.getParkName());
        tv9.setText("地址: " + park.getAddress());
        tv10.setText("距离：" + park.getDistance() + "km");
        if (park.getOpen().equals("Y")) {
            tv11.setText("对外开放");
        } else {
            tv11.setText("不对外开放");
        }
        tv12.setText("停车费: " + park.getRates() + "元/小时");
        tv13.setText("剩余车位: " + park.getVacancy());
        tv14.setText("收费参考：每小时"+park.getRates()+"元/小时，最高"+park.getPriceCaps()+"元/天");
    }

    private void initView(View iv) {
        tv8 = (TextView) iv.findViewById(R.id.tv8);
        tv9 = (TextView) iv.findViewById(R.id.tv9);
        tv10 = (TextView) iv.findViewById(R.id.tv10);
        tv11 = (TextView) iv.findViewById(R.id.tv11);
        tv12 = (TextView) iv.findViewById(R.id.tv12);
        tv13 = (TextView) iv.findViewById(R.id.tv13);
        tv14 = (TextView) iv.findViewById(R.id.tv14);
    }
}
